package com.qeegoo.b2bautozityp.widget;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.flyco.animation.SlideEnter.SlideBottomEnter;
import com.flyco.animation.SlideExit.SlideBottomExit;
import com.flyco.dialog.widget.base.BaseDialog;
import com.qeegoo.b2bautozityp.R;

/**
 * Created by lining on 2017/10/17.
 */

public class OrderDeliveryDialog extends BaseDialog<OrderDeliveryDialog> {

    private Context mContext;
    private TextView  mTvCan;
    private OnDialogFinishListener mListener;

    public OrderDeliveryDialog(Context context,OnDialogFinishListener listener) {
        super(context);
        mContext = context;
        mListener = listener;
    }

    @Override
    public View onCreateView() {
        showAnim(new SlideBottomEnter());
        dismissAnim(new SlideBottomExit());

        View inflate = View.inflate(mContext, R.layout.layout_order_delivery_success, null);
        mTvCan = (TextView) inflate.findViewById(R.id.tv_confirm);
        return inflate;
    }

    @Override
    public void setUiBeforShow() {
        mTvCan.setOnClickListener(v -> {
            mListener.onFinish();
        });
    }

    public void setDialogFinishListener(OnDialogFinishListener listener){
        mListener = listener;
    }

    public interface OnDialogFinishListener{
        void onFinish();
        void onCancel();
    }
}
